﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TournamentDatabase.Objects;

namespace TournamentDatabase.Database
{
	public enum OrderBy
	{
		Ascending,
		Descending,
		None
	}

	public interface IOracleAccessor
	{
		List<Member> QueryMember(string whereClause, OrderBy order, string orderColumn);
		List<Competitor> QueryCompetitor(string whereClause, OrderBy order, string orderColumn);
		List<Judge> QueryJudge(string whereClause, OrderBy order, string orderColumn);
		List<Organiser> QueryOrganiser(string whereClause, OrderBy order, string orderColumn);
		List<Tournament> QueryTournament(string whereClause, OrderBy order, string orderColumn);
		List<Competition> QueryCompetition(string whereClause, OrderBy order, string orderColumn);
		List<CompetesIn> QueryCompetesIn(string whereClause, OrderBy order, string orderColumn);
		List<JudgesIn> QueryJudgesIn(string whereClause, OrderBy order, string orderColumn);
		List<Organises> QueryOrganises(string whereClause, OrderBy order, string orderColumn);

		void CreateMember(Member member);
		void CreateCompetitor(Competitor competitor);
		void CreateJudge(Judge judge);
		void CreateOrganiser(Organiser organiser);
		void CreateTournament(Tournament tournament);
		void CreateCompetition(Competition competititon);
		void CreateCompetesIn(CompetesIn competesIn, Competition competition);
		void CreateJudgesIn(JudgesIn judgesIn, Competition competition);
		void CreateOrganises(Organises organises, Tournament tournament);

		void UpdateMember(Member member);
		void UpdateCompetitor(Competitor competitor);
		void UpdateJudge(Judge judge);
		void UpdateOrganiser(Organiser organiser);
		void UpdateTournament(Tournament tournament);
		void UpdateCompetition(Competition competititon);
		void UpdateCompetesIn(CompetesIn competesIn, Competition competition);
		void UpdateJudgesIn(JudgesIn judgesIn, Competition competition);
		void UpdateOrganises(Organises organises, Tournament tournament);

		void DeleteMember(Member member);
		void DeleteCompetitor(Competitor competitor);
		void DeleteJudge(Judge judge);
		void DeleteOrganiser(Organiser organiser);
		void DeleteTournament(Tournament tournament);
		void DeleteCompetition(Competition competititon);
		void DeleteCompetesIn(CompetesIn competesIn, Competition competition);
		void DeleteJudgesIn(JudgesIn judgesIn, Competition competition);
		void DeleteOrganises(Organises organises, Tournament tournament);

		void StartTransaction();
		void CommitTransaction();
	}
}
